package java67_19;

public class MathTest {

	public static void main(String[] args) {
		int a = 0x16FC;// 1*16^1+6=22
		int b = 016;
		int c = 0b100010011;
		System.out.println(a);
		System.out.println(b);
		System.out.println(c);
		System.out.println("左移,右移");
		int k = 110;
		int h = k >> 2;// 二进制
		// 110 =>0000000000000000 1101110
		// 11011//右移就是除法,移动一位就是除 2
		// 左移是乘法,移动1位就是*2,

		System.out.println(h);// 27
		// 0000000000000000 11011100
		int h2 = k << 1;
		System.out.println(h2);
		System.out.println(">>>>>>>>>>>负数>>>>>>>>>");
		// 补码方式存储
		k = -110;
		int h4 = k >> 2;
		System.out.println(h4);
		int h5 = k >>> 3;
		System.out.println(h5);
	}

}
